package cloud.estate.estateManager.controller;

import cloud.estate.commons.bean.EstateManager;
import cloud.estate.commons.util.JsonResult;
import cloud.estate.estateManager.service.estateManagerService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/estateManager")
public class estateManagerController {
    @Resource
    private estateManagerService estateManagerService;
    @PostMapping("/addOneEstateManager")
    public JsonResult addOneEstateManager(EstateManager estateManager){
        return estateManagerService.addOneEstateManager(estateManager);
    }
    @PostMapping("/deleteOneEstateManager")
    public JsonResult deleteOneEstateManager(String id){
        return estateManagerService.deleteOneEstateManager(id);
    }
    @PostMapping("/updateOneEstateManager")
    public JsonResult updateOneEstateManager(EstateManager estateManager){
        return estateManagerService.updateOneEstateManager(estateManager);
    }
    @GetMapping("/getOneEstateManager")
    public JsonResult getOneEstateManager(String id){
        return estateManagerService.getOneEstateManager(id);
    }
    @GetMapping("/listAllEstateManager")
    public JsonResult listAllEstateManager(){
        return estateManagerService.listAllEstateManager();
    }
}

